/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 StdDataTypesCoderGrammar.hpp. Created on: 03.11.2010 18:59:45 
 */

#ifndef STDDATATYPESCODERGRAMMAR_HPP_
#define STDDATATYPESCODERGRAMMAR_HPP_

#include "smartobjects/SmartObjectsDefs.hpp"
#include "smartobjects/ISerializableObject.hpp"

namespace smartobjects {

class StdDataTypesCoderGrammar : public ISerializableObject, public virtual RefObject {
public:
	SO_DLLPRFX StdDataTypesCoderGrammar();
	SO_DLLPRFX virtual ~StdDataTypesCoderGrammar();

	SO_DLLPRFX virtual void serialize(IDataTypesCoder* poCoder, IDataEncrypter* poEncrypter, ByteBuffer* poToBuffer) const;
	SO_DLLPRFX virtual void deserialize(IDataTypesCoder* poCoder, IDataEncrypter* poEncrypter, ByteBuffer* poFromBuffer);

	SO_DLLPRFX virtual const std::string& getObjectType() const;

	SO_DLLPRFX virtual unsigned int registerGrammarElement(const std::string& sNamedObject);
	SO_DLLPRFX virtual const std::string& findGrammarElement(int id);

	SO_DLLPRFX virtual void reset();

protected:
	typedef boost::bimap<std::string, boost::uint32_t> GrammarStorage;
	GrammarStorage m_mStorage;
};

}

#endif /* STDDATATYPESCODERGRAMMAR_HPP_ */
